﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using Irony.Ast;
using Irony.Interpreter;
using Irony.Parsing;

namespace ConciseMarkupLanguage.Ast
{
    class BooleanNode : AstNode
    {
        bool _value;

        public override void Init(ParsingContext context, ParseTreeNode treeNode)
        {
            base.Init(context, treeNode);
            _value = Convert.ToBoolean(treeNode.FindTokenAndGetText());
        }

        public override void EvaluateNode(EvaluationContext context, AstMode mode)
        {
            context.Data.Push(_value);
        }
    }
}
